package com.example.warehousems.vo;

import com.alibaba.fastjson.JSON;
import com.example.warehousems.dao.model.Branch;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.Date;

@Data
public class CargoVO {
    @NotNull(message = "缺少名称")
    private String name;
    @NotNull(message = "缺少长度")
    @Min(0)
    private Float length;
    @NotNull(message = "缺少宽度")
    @Min(0)
    private Float width;
    @NotNull(message = "缺少高度")
    @Min(0)
    private Float height;
    @NotNull(message = "缺少重量")
    @Min(0)
    private Float weight;
    @NotNull(message = "缺少目的仓库")
    private Integer outBranch;

    @Override
    public String toString() {
        return "{" +
                "\"name\":\"" + name +
                "\", \"length\":" + length +
                ", \"width\":" + width +
                ", \"height\":" + height +
                ", \"weight\":" + weight +
                ", \"outBranch\":" + JSON.toJSONString(outBranch) +
                '}';
    }
}
